package com.gosophia.taskManagement.action;

import java.net.URLEncoder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.gosophia.commons.web.action.BaseSupportAction;
import com.gosophia.taskManagement.dto.MissionDTO;
import com.gosophia.taskManagement.ws.TaskManagementWebService;

/**
 * 查看任务查询列表中的详细信息
 * @author mayue
 *
 */
@Controller("GetMissionDetail")
@Scope("prototype")
public class FindMissionDetail extends BaseSupportAction{
    
    private static final long serialVersionUID = 1L;

    @Autowired
    private TaskManagementWebService taskManagementWebService;
    
    private MissionDTO missionDTO;

    @Override
    public String _execute() throws Exception {
        missionDTO = taskManagementWebService.findMissionDetailByMissionId(missionDTO.getMissionId());
        if(missionDTO!=null){
            super.getRequestResult().setRsltCode("0");
        }else{
            super.getRequestResult().setRsltCode("1");
            super.getRequestResult().setMessage(URLEncoder.encode("该条记录已被删除,请刷新列表","utf-8"));
        }
        
        return SUCCESS;
    }

    public MissionDTO getMissionDTO() {
        return missionDTO;
    }

    public void setMissionDTO(MissionDTO missionDTO) {
        this.missionDTO = missionDTO;
    }

    
}
